<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father {
            width: 300px;
            height: 300px;
            background-color: #f00;
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- 
            .self 代表这个事件只能由自身触发，不能由冒泡触发
            .once 代表事件只会绑定一次
         -->
        <div @click.once.self="fn1" class="father">
            <button>按钮1</button>
            <button>按钮2</button>
            <button>按钮3</button>
            <input type="text">
        </div>
    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            methods: {
                fn1 () {
                    alert('父盒子被点了')
                }
            }
        })
    </script>
</body>
</html>